package com.lg.happyfarmer.activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.util.DisplayMetrics;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.hemaapp.hm_FrameWork.HemaNetTask;
import com.hemaapp.hm_FrameWork.result.HemaBaseResult;
import com.lg.happyfarmer.R;
import com.lg.happyfarmer.adapter.FirstPageAdapter;
import com.lg.happyfarmer.base.BaseFragmentActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 首页
 * Created by Torres on 2018/4/25.
 */

public class FirstActivity extends BaseFragmentActivity{

    @Bind(R.id.iv_logo)
    ImageView iv_logo;
    @Bind(R.id.fl_search)
    FrameLayout fl_search;
    @Bind(R.id.tabLayout)
    TabLayout tabLayout;
    @Bind(R.id.viewPager)
    ViewPager viewPager;
    private FirstPageAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_first);
        ButterKnife.bind(this);
        super.onCreate(savedInstanceState);
        DisplayMetrics dm = new DisplayMetrics();
        getWindowManager().getDefaultDisplay().getMetrics(dm);
        viewPager.setCurrentItem(0);
        adapter = new FirstPageAdapter(getSupportFragmentManager(), false);
        viewPager.setAdapter(adapter);//给ViewPager设置适配器
        tabLayout.setupWithViewPager(viewPager);//将TabLayout和ViewPager关联起来。
        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);//设置tab模式，可以滚动
    }

    @Override
    protected void findView() {

    }

    @Override
    protected void callBeforeDataBack(HemaNetTask netTask) {
    }

    @Override
    protected void callAfterDataBack(HemaNetTask netTask) {
    }

    @Override
    protected void callBackForServerSuccess(HemaNetTask netTask, HemaBaseResult baseResult) {
    }

    @Override
    protected void callBackForServerFailed(HemaNetTask netTask, HemaBaseResult baseResult) {
    }

    @Override
    protected void callBackForGetDataFailed(HemaNetTask netTask, int failedType) {
    }

    @Override
    protected void getExras() {
    }

    @Override
    protected void setListener() {
    }
}
